package com.qc.bug.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.qc.bug.pojo.BugInfo;
import com.qc.bug.pojo.UserInfo;
import com.qc.bug.services.bugInfo.BugInfoServices;
import com.qc.bug.util.MyCons;

@Controller
@RequestMapping(value = "/bugInfo")
public class BugInfoController {

	@Autowired
	private BugInfoServices bugInfoBiz;

	@RequestMapping(value = "/addBugInfo")
	public String addBugInfo(BugInfo bugInfo, HttpSession session) {
		UserInfo userInfo = (UserInfo) session.getAttribute(MyCons.USRE_LOGIN);
		bugInfo.setAddpersonid(userInfo.getUserid());

		bugInfoBiz.addBugInfo(bugInfo);

		return "user_back/index";
	}
}
